﻿namespace WMS6.Web.Outbound
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class OrderTrackingQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlOperatingDate;
        protected DropDownList ddlOperator;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlTypeOper;
        protected HtmlForm F7950;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img1;
        protected Label lblOperatingDate;
        protected Label lblOperator;
        protected Label lblOrderID;
        protected Label lblOrderTrackingQuery;
        protected Label lblStatus;
        protected Label lblType;
        protected MultipleSelectControl MSCStatus;
        protected MultipleSelectControl MSCType;
        protected HtmlLink mycss;
        protected TextBox txtOperatingDate;
        protected TextBox txtOperatingDate2;
        protected TextBox txtOperator;
        protected TextBox txtOrderID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("OrderTrackingList.aspx", false);
        }

        private void LoadDDl()
        {
            base.BindData2DDLBySysCode(this.MSCType, "OrderType");
            base.BindData2DDLBySysCode(this.MSCStatus, "OrderStatus");
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlOperator, 0);
            base.InitQueryDDL(this.ddlOperatingDate, 1);
            base.InitQueryDDL(this.ddlTypeOper, 0);
            this.ddlTypeOper.SelectedValue = "One Of";
            base.InitQueryDDL(this.ddlStatusOper, 0);
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string OperatingDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOperatingDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOperatingDate.Text.Trim(), this.ddlOperatingDate.SelectedValue, this.txtOperatingDate2.Text.Trim(), "OperatingDate");
                }
                return "";
            }
        }

        public string Operator
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOperator.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOperator.Text.Trim(), this.ddlOperator.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string Type
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCType.ReturnValue, this.ddlTypeOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

